package com.ushio.gougouwangguo.utils;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;

public class MyBeanUtils {

    public static <T, R> Page<R> convertPage(Page<T> page, List<R> records) {
        Page<R> result = new Page<>();
        result.setCurrent(page.getCurrent());
        result.setSize(page.getSize());
        result.setTotal(page.getTotal());
        result.setPages(page.getPages());
        result.setRecords(records);
        return result;
    }

}
